<?php

namespace app\admin\controller;

use \app\common\controller\BaseController;
use extend\oss\DirectTransfer;
use think\Response;

class LoginController extends BaseController
{
    public function forget()
    {
        return $this->logic->forget($this->request);
    }

    public function quit()
    {
        return $this->logic->quit($this->request);
    }

    public function error()
    {
        return $this->logic->error($this->request);
    }

    public function oss()
    {
        return view('oss_demo');
    }

    public function test2()
    {
        $request['endpoint'] = 'https://kb-video.oss-cn-beijing.aliyuncs.com';
        $request['callbackUrl'] = 'https://project.kbglc.com/admin/test3';
        $request['filePath'] = 'video/' . date('Y-m-d') . '/';
        $response = (new DirectTransfer())->authorize($request);

        return Response::create(['status' => 200, 'msg' => 'success', 'data' => $response], 'json', 200)->header([]);
    }

    public function test3()
    {
        return Response::create(['status' => 200, 'msg' => 'success'], 'json', 200)->header([]);
    }
}